﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using snat.model;

namespace algorithms.algorithms.Example
{
    public class ExampleProgram {

private static void Main(string[] args) {
    // Details of the server access where a database which fits the SNAT schema
    String host = "MySQL5Sserver.ac.uk";
    int port = 3306;
    String databaseName = "SocialNetworkAnalysisDatabase";
    String username = "username1";
    String password = "password1";

    // Connect the network model to the database detailed above
    NetworkModel.Instance.Connect(host, port, databaseName, username, password);
            
    // Instantiate all the algorithms which are to run on the dataset
    MultiRecipientMessageCounter networkBasedAlgorithm = new MultiRecipientMessageCounter();
    NodeBasedMultiRecipientMessageCounter nodeBasedAlgorithm = new NodeBasedMultiRecipientMessageCounter();

    // Initialize the nodes in the network model
    NetworkModel.Instance.InitNodes();

    // Register those algorithms which are to run on the dataset
    networkBasedAlgorithm.Register();
    nodeBasedAlgorithm.Register();
            
    // Initialize the network model
    NetworkModel.Instance.Init();

    // Play through all messages in the database
    NetworkModel.Instance.Play();
}

    }
}
